package makabakaquestionnaire.zutsoftware.framework.manager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

@Component
public class ShutdownManager {
    private static final Logger logger = LoggerFactory.getLogger("manager");

    @PreDestroy
    public void destroy(){
        shutdownAsyncManager();
    }
    public void shutdownAsyncManager(){
        try{
            logger.info("====关闭后台任务任务线程池====");
            ExecutorManager.getExecutorManager().shutdown();
        }catch (Exception e){
            logger.error(e.getMessage(), e);
        }
    }


}
